#ifndef PACKAGEQUEUE_H_
#define PACKAGEQUEUE_H_


#include "CliPackage.h"
#include <vector>
#include "RateManagement.h"
#include "tasks/TaskHandle.h"
#include "OscarServerConTypes.h"
#include "tasks/TaskManager.h"

namespace Impp
{

class TaskManager;

struct QueuePackage{
	CliPackage* pack;
	Rate* rate;
	Priority priority;
	TaskHandle handleType;
	qword handle;
};

class PackageQueue
{
private:
	RateManagement* rates;
	std::vector<QueuePackage> queue;
	TaskManager* tasks;
	
public:
	PackageQueue();
	virtual ~PackageQueue();
	
	void setTaskManager(TaskManager* tasks);
	void setRateManagement(RateManagement* rates);
	void deleteQueue();
	void addToQueue(CliPackage* pack, const Priority & priority, const TaskHandle & handleType, const qword & handle);
	QueuePackage getNextPackageToSend();
	
	static const bool cmp(const QueuePackage & a, const QueuePackage & b);
	
};

}

#endif /*PACKAGEQUEUE_H_*/
